﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SelfManagement.Database.POCO;

namespace SelfManagement.IServices
{
    public interface IArticleService: IBaseService<Article>
    {
        /// <summary>
        /// 根据用户id获取用户的文章
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        IQueryable<Article> QueryUserArticles(string uid);

        /// <summary>
        /// 根据用户id和文章类型查找用户的文章
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        IQueryable<Article> QueryUserAriticlesByCategoryId(string uid, string categoryId);

        /// <summary>
        /// 根据用户的id和文章id获取文章
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="articleId"></param>
        /// <returns></returns>
        Article GetUserArticleById(string uid, string articleId);

        /// <summary>
        /// 根据id获取文章
        /// </summary>
        /// <param name="articleId"></param>
        /// <returns></returns>
        Article GetArticleById(string articleId);

        /// <summary>
        /// 删除文章
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="articleId"></param>
        /// <returns></returns>
        bool DeleteUserArticleById(string uid, string articleId);
    }
}
